
/**
 * First we will load all of this project's JavaScript dependencies which
 * include Vue and Vue Resource. This gives a great starting point for
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');
import Vue from 'vue'
import VueRouter from 'vue-router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import VeeValidate, {Validator} from 'vee-validate'
Vue.use(VeeValidate)
Vue.use(VueAxios,axios)
Vue.use(VueRouter)
import App from './components/App.vue'
import apiVue from './components/pages/Home.vue'
import about from './components/pages/About.vue'
import post from './components/posts/Post.vue'
import register from './components/register/Register.vue'
import comfirm from './components/comfirm/Email.vue'
const router = new VueRouter({
    mode: 'history',
    base: __dirname, //这个很重要
    routes: [
        { path: '/api/vue/index', component: apiVue },
        { path: '/api/vue/about', component: about },
        { path: '/api/vue/post/:id',name:'posts', component: post },
        { path: '/api/vue/register',name:'register', component: register },
        { path: '/api/vue/comfirm',name:'comfirm', component: comfirm }
    ]
})

//console.log(Vue.axios.get('http://mg.com/api').then((response) => {
//        console.log(response.data)
//}))
Vue.component('app',App)
new Vue({
    router,
    el: '#app',
})
